<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<script>
    let days = [
        '2016-02-28',
        '2016-02-29', // 闰月
        '2016-03-01', // 跨月
        '2016-03-02',
        '2016-03-03'
    ];

    function five(days){
        var times=days.map(function (day) {
            return new Date(day).getTime();
        });
        //console.log(times);
        var min=Math.min.apply(null,times);
        var max=Math.max.apply(null,times);
        return 1000*3600*24==(max-min)/4;
    }

    console.log(five(days));

    //去除时分秒
    function five2(days){
        var times=days.map(function (day) {
            var d=new Date(day);
            return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
        });
        //console.log(times);
        var min=Math.min.apply(null,times);
        var max=Math.max.apply(null,times);
        //console.log(min,max);
        return 1000*3600*24==(max-min)/4;
    }

    console.log(five2(days));
</script>
</body>
</html>